(function () {
    angular
        .module('ita')
        .controller('ita.controller.DetailCtrl', DetailCtrl);

    DetailCtrl.$inject = [
        '$scope',
        '$location',
        '$routeParams',
        'ita.controller.TraineesService'
    ];

    function DetailCtrl($scope, $location, $routeParams, traineeSvc) {
        var vm = this;
        vm.domainId = $routeParams.domainId || '';

        traineeSvc.getTraineeByDomainId(vm.domainId, function(err, trainee) {
            vm.trainee = trainee;
        });

        vm.update = function(){
            console.log("开始更新");
            traineeSvc.updateTrainee(vm.trainee, function(err, doc){
                vm.updateRes = doc;
            });
        };
    }
})();
